﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Principal;

namespace MiserBlogMVC.Models
{
    public class UserPrincipal : IPrincipal
    {
        private A_BaseIdentity _identity;

        public UserPrincipal(A_BaseIdentity identity)
        {
            this._identity = identity;
        }

        public IIdentity Identity
        {
            get { return _identity; }
        }

        public bool IsInRole(string role)
        {
            if (role == this._identity.Role.ToString()) return true;
            return false;
        }
    }
}